package com.zjj.spring.read.xml.processor;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;

/**
 * 这个接口的语义与BeanPostProcessor类似，但有一个主要的不同点：
 * <p>
 * BeanFactoryPostProcessor操作bean的配置元数据；
 * 也就是说，Spring的IoC容器允许 BeanFactoryPostProcessor来读取配置元数据
 * 并在容器实例化任何bean(除了BeanFactoryPostProcessor)之前可以修改它。
 * </p>
 * @author zhuangjiajie778
 *
 */
public class MyFactoryPostProcessorBean implements BeanFactoryPostProcessor {
    
	public void postProcessBeanFactory(ConfigurableListableBeanFactory configurablelistablebeanfactory) throws BeansException {
		System.out.println("【BAP】---------------Enter MyFactoryPostProcessorBean.postProcessBeanFactory() from BeanFactoryPostProcessor---------------");
		System.out.println("【BAP】myFactoryPostProcessorBean = " + configurablelistablebeanfactory.getBean("myFactoryPostProcessorBean"));
		System.out.println("【BAP】---------------Exit  MyFactoryPostProcessorBean.postProcessBeanFactory() from BeanFactoryPostProcessor---------------");
		System.out.println();	
	}
}